/*
 * @Author: szx
 * @Date: 2022-03-05 13:30:33
 * @LastEditTime: 2022-03-05 13:33:38
 * @Description:
 * @FilePath: \leetcode\1200-1299\1287\1287.js
 */
/**
 * @param {number[]} arr
 * @return {number}
 */
 var findSpecialInteger = function (arr) {
    const n = Math.floor(arr.length / 4);
    let cnt = 1;
    for (let i = 1; i < arr.length; i++) {
        if (arr[i] == arr[i - 1]) {
            cnt++;
            if (cnt > n) return arr[i];
        } else cnt = 1;
    }
    return arr[0]
};
